HD

Section: User Commands (1)
Updated: JUNE 2, 1989
Index Return to Main Contents
 

NAME

hd - hexadecimal dump  

SYNOPSIS

hd [ -cnov ] [ -b n ] [ -sp | -sn n ] [ -sb n ] [ -eb n ] filename  

DESCRIPTION

hd produces a hex dump of the specified file or the data that is piped into it from the standard input.

The format of the dump is basically hex values on the left, in groups of 16 and corresponding ascii values on the right. Only printable ascii values are printed as themselves, all other ascii values are output as fullstops.

There are various options to hd which allow further formatting of the output, and control over the start and end of the output.

Note that byte counting starts from 0; record (block) counting starts from 1, after the start position which has been given (if any).

Options:

-b n
(block size): sets the block size to n (where n may be a decimal or C standard hexadecimal or octal number). Ommision of this option will cause a continuous stream of output with no breaks unless the -n option is used.
-c
(compress): compresses similar lines to a single char, "*". The complete line just before the first char is the one which is repeated. This does not cross block boundaries.
-n
(numbering): enables block numbering, each block will be labelled giving its number from the start of the file or the start block. The final block printed has its size printed also, if it is less than the specified or default block size. Used without the -b option causes 1024 byte blocks to be output.
-o
(offset): prints the offset within the file on the very left hand side of the output.
-sp n
(start posn, print): this causes any blocking options that have been specified to start after the n'th byte in the file, the first n bytes are printed in one continuous block. This option takes precedence over -sn.
-sn n
(start posn, no print): output will commence starting after the n'th byte, the first n bytes not being printed. n may be a decimal or C standard hexadecimal or octal number, and is held as a long to allow starting deep in a file.
-v
(version): print the version number of hd.
-sb n
(start block) output will commence starting after the n'th block in the file.
-eb n
(end block) output will cease after the n'th block in the file.
 

AUTHOR

Peter Ruczynski
 

FUTURE ENHANCEMENTS

Offset printing in different bases, currently only in hexadecimal.


 

Index

NAME
SYNOPSIS
DESCRIPTION
AUTHOR
FUTURE ENHANCEMENTS

This document was created by man2html, using the manual pages.
Time: 13:29:00 GMT, February 12, 2023